import request from "./request";

// 查询动态表单列表
export function getDynamicList(query) {
  return request({
    url: "/camunda/workflow/list",
    method: "get",
    params: query,
  });
}

/**
 * 新增动态表单
 * @param {*} data
 * @returns
 */
export function addDynamic(data) {
  return request({
    url: "/camunda/workflow",
    method: "post",
    data: data,
  });
}

// 更新表单数据
export function updateDynamic(data) {
  return request({
    url: "/camunda/workflow",
    method: "put",
    data: data,
  });
}

/**
 * 根据 表单Id 删除动态表单
 * @param {*} id 表单数据
 * @returns
 */
export function delDynamic(id) {
  return request({
    url: `/camunda/workflow/${id}`,
    method: "delete",
  });
}

/**
 * 根据 动态表单Id 获取表单数据
 * @param {*} id 表单Id
 * @returns
 */
export function getDynamicById(id) {
  return request({
    url: `/camunda/workflow/${id}`,
    method: "get",
  });
}
